#pragma once

#include "fxcc/core/pch.h"
#include "fxcc/core/platform/common/Input.h"

namespace fxcc
{
	namespace platform
	{
		namespace common
		{
			struct FXCC_API App
			{
				struct FXCC_API Desc
				{
					glm::ivec2 m_Pos;
					glm::ivec2 m_Size;
					std::string m_Title;
					float m_ScaleFactor;

					bool m_Minisize{ false };
					int m_Interval;

					bool m_Focused;
					bool m_Iconify;

					glm::vec2 SizeF()
					{
						return glm::vec2((float)m_Size.x, (float)m_Size.y);
					};

					float Aspect() const
					{
						if (m_Size.y == 0)
						{
							return 1.0f;
						}
						return (float)m_Size.x / (float)m_Size.y;
					}

					Desc() :m_Interval(0), m_Focused(false), m_Iconify(false), m_Pos(0), m_Size(glm::ivec2(800, 600)),m_ScaleFactor(1.0f)
					{

					}
					std::wstring GetTitleW()
					{
						std::wstring wtitle(m_Title.begin(), m_Title.end());
						return wtitle;
					}
					glm::ivec2 GetGflwPos()
					{
						return glm::ivec2(m_Pos.x * m_ScaleFactor, m_Pos.x * m_ScaleFactor);
					};
					glm::ivec2 GetGflwSize()
					{
						return glm::ivec2(m_Size.x * m_ScaleFactor, m_Size.y * m_ScaleFactor);
					}

				}m_Desc;

				Input m_Input;
				App(const App::Desc& desc) :m_Desc(desc) {};

				const Input& GetInput() const
				{
					return m_Input;
				}
		
		
			};
		}
	}
}
